﻿namespace Creek.UI.Effects
{
    using System;

    /// <summary>
    /// 	Manages transitions for double properties.
    /// </summary>
    internal class ManagedType_Double : IManagedType
    {
        #region Public Methods and Operators

        /// <summary>
        /// 	Returns a copy of the double passed in.
        /// </summary>
        public object copy(object o)
        {
            var d = (double)o;
            return d;
        }

        /// <summary>
        /// 	Returns the value between start and end for the percentage passed in.
        /// </summary>
        public object getIntermediateValue(object start, object end, double dPercentage)
        {
            var dStart = (double)start;
            var dEnd = (double)end;
            return Utility.interpolate(dStart, dEnd, dPercentage);
        }

        /// <summary>
        /// 	Returns the type managed by this class.
        /// </summary>
        public Type getManagedType()
        {
            return typeof(double);
        }

        #endregion
    }
}